using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OracleClient;

using DQS.EL;

namespace DQS.DAL
{
    public static class DQ_SetColumnsService
    {
        public static void InsertColumns(IList<DQ_SETCOLUMNS> argCols)
        {
            String colStr = String.Empty;
            foreach(DQ_SETCOLUMNS setCol in argCols)
            {
                colStr += (setCol.COL_ID + "|");
            }
            colStr = colStr.Substring(0, colStr.Length - 1);
            string sqlStr = "DQ_Insert_Columns_P";
            OracleParameter[] _params = { 
                new OracleParameter("query_id",OracleType.Number),
                new OracleParameter("col_id",OracleType.Clob)
            };
            _params[0].Value = argCols[0].QUERY_ID;
            _params[1].Value = colStr;
            OracleHelper.ExecuteNonQuery(sqlStr, CommandType.StoredProcedure, _params);            
        }
    }
}
